<template>
<el-config-provider :size="getGlobalComponentSize" >
    <router-view v-show="setLockScreen" />
    <LockScreen v-if="themeConfig.isLockScreen" />
</el-config-provider>
</template>
<script setup name="app">
// import useTagsViewRoutes  from '/@/stores/tagsViewRoutes';
import { useThemeConfig } from '/@/stores/themeConfig';
import other from '/@/utils/other';
// import { Local, Session } from '/@/utils/storage';
// import mittBus from '/@/utils/mitt';
// import setIntroduction from '/@/utils/setIconfont';
import {computed, defineAsyncComponent} from "vue";
import {storeToRefs} from "pinia";

// 引入组件
const LockScreen = defineAsyncComponent(() => import('/@/layout/lockScreen/index.vue'));
// const Setings = defineAsyncComponent(() => import('/@/layout/navBars/breadcrumb/setings.vue'));
// const CloseFull = defineAsyncComponent(() => import('/@/layout/navBars/breadcrumb/closeFull.vue'));

const storesThemeConfig = useThemeConfig();
const { themeConfig } = storeToRefs(storesThemeConfig);

// 获取全局组件大小
const getGlobalComponentSize = computed(() => {
  return other.globalComponentSize();
});

// 设置锁屏时组件显示隐藏
const setLockScreen = computed(() => {
  // 防止锁屏后，刷新出现不相关界面
  // https://gitee.com/lyt-top/vue-next-admin/issues/I6AF8P
  return themeConfig.value.isLockScreen ? themeConfig.value.lockScreenTime > 1 : themeConfig.value.lockScreenTime >= 0;
});

</script>